package com.madarasan.resorts;

import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
import com.madarasan.SkiDroid.GlobalMenuActivity;
import com.madarasan.SkiDroid.R;
import com.madarasan.SkiDroid.MyApplication;

public class ShowResortGeneralInfo extends GlobalMenuActivity {
	private String title;
	private String description;

	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);

		setContentView(R.layout.resortgeneralinfolayout);

		Log.i("ShowResortGeneralinfo", "onCreate called");
		
		
		//Notify user via status bar notification		
		displayNotification(getApplicationContext().getResources().getString(R.string.application_finishdownload));

		title = ((MyApplication) this.getApplication()).getTitle();
		description = ((MyApplication) this.getApplication()).getDescription();

		TextView resortTitleView = (TextView) findViewById(R.id.resort_titleTextView);
		resortTitleView.setText(title + " - ");

		// Log.i("ShowResortGeneralInfo", "title is" + title);

		TextView descriptionView = (TextView) findViewById(R.id.resort_slopedescriptionTextView);
		descriptionView.setText(description);

		ImageView image = (ImageView) findViewById(R.id.resort_slopeImage);

		if (getResources().getIdentifier(
				"drawable/resorts_" + title.toLowerCase().replaceAll(" ", ""),
				"drawable", getPackageName()) > 0) {

			image.setImageDrawable(getResources().getDrawable(
					getResources().getIdentifier(
							"drawable/resorts_"
									+ title.toLowerCase().replaceAll(" ", ""),
							"drawable", getPackageName())));

		}
		
		/*new Handler().postDelayed(new Runnable() { 
	        @Override 
	        public void run() { 
	                openOptionsMenu(); 
	        } 
	}, 500); */

	}

}
